package database;


import java.sql.SQLException;

import org.junit.Test;

/**
 * Test the dummy accepts the typical input given to a real SQL server. 
 */
public class testDummySQLServer {
	DummySQLServer testServer = new DummySQLServer();
	final String TABLENAME = "clientlist";
	final String HENK1 = " givenname = 'Henk' , lastname = 'Vries',  address = 'Delft',  phone = '0900henk',  email = 'Delft@mail.com' ";
	final String HENK2 = " givenname = 'Henk2' , lastname = 'Vries2',  address = 'Delft2',  phone = '0900henk',  email = 'Delft@mail.com' ";
	
	@Test
	public void testUpdateSelect() throws SQLException {
		testServer.update("TRUNCATE TABLE " + "clientList" + ";");
		testServer.update("INSERT INTO " + TABLENAME + " SET id = 1, " + HENK1 +";");
		testServer.update("INSERT INTO " + TABLENAME + " SET id = 2, " + HENK2 +";");
		testServer.select("SELECT * FROM " + "clientlist" + ";");
		testServer.disconnect();
	}	
}